package com.tbit.uqbike.webmanager.dao.stat;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.tbit.config.datasource.DataSource;
import com.tbit.manager.api.dto.UserStatParam;
import com.tbit.manager.api.vo.LineChartData;
import com.tbit.uqbike.object.pojo.MoneyData;
import com.tbit.uqbike.object.pojo.StatPark;

import com.tbit.uqbike.object.pojo.statistics.VipCardOrderDaySta;

import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;

@DS(DataSource.STAT)
public interface VipCardOrderDayStaDao {
    int insert(VipCardOrderDaySta record);

    int insertSelective(VipCardOrderDaySta record);

    List<VipCardOrderDaySta> queryByMap(Map<String, Object> params);

    /**
     * 月报、根据时间查询日预统计数据
     *
     * @param params 参数个数
     * @return {@link List}<{@link VipCardOrderDaySta}>
     */
    List<VipCardOrderDaySta> selectDateByMap(Map<String, Object> params);

    void insertBatch(@Param("entities") List<Map<String, Object>> vipCards);

    void insertByMap(Map<String, Object> maps);

    List<MoneyData> groupByAccountId(Map<String, Object> map1);

    void update(VipCardOrderDaySta vipCardOrderDaySta);

    List<StatPark> groupByDay(Map<String, Object> params);


    VipCardOrderDaySta getVipIncome(Map<String, Object> params);

    /**
     * 查询所有的会员卡日统计记录
     */
    List<VipCardOrderDaySta> getVipCardNumDay(Map<String, Object> params);

    /**
     * 获取区域内会员卡最早一天的数据量
     */
    Date getVipCardEarliestData(Integer accountId);

    /**
     * 删除会员卡预统计数据
     * @param accountIdList 区域id
     * @param st 开始时间
     * @param et 结束时间
     */
    void deleteById(@Param("List") List<Integer> accountIdList, @Param("st") String st, @Param("et") String et);

    /**
     * 统计会员用户总户数
     * 取区间的右区间
     * @param param
     * @return
     */
    Long vipUserCount(@Param("param") UserStatParam param);

    /**
     * 统计会员用户增长
     * @param param
     * @return
     */
    List<LineChartData> newVipLineChart_Day(@Param("param") UserStatParam param);
}